package com.winer.controller;

import com.winer.dto.UserDTO;
import com.winer.dto.Result;
import com.winer.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/login")
public class loginController {


    @Autowired
    private LoginService loginService;
    @PostMapping("/sendCode")
    public Result sendCode (@RequestBody UserDTO userDTO) {


        return loginService.sendCode(userDTO);
    }


    @PostMapping("/login")
    public Result login (@RequestBody UserDTO userDTO) {

        return loginService.userLogin(userDTO);
    }

    @GetMapping("/test")
    public Result test(){
        return Result.ok("测试成功");
    }
}
